<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>班级管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#btnReset").click(function () {
				$("#className").val("");
				$("#classCode").val("");
			});
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
	<style type="text/css">
		.minWidth {
			min-width: 177px;
		}	
		.autoWidth {
		    width: auto;
		}	
		.select2-choices{
		    border-radius: 4px;
		}	
		#contentTable td ,#contentTable th{
			text-align: center;
			padding: 1px 20px;
		}
		#contentTable tbody tr td{
			font-size: 13px;
		}
   </style>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/classinfo/classInfo/">班级列表</a></li>
		<shiro:hasPermission name="classinfo:classInfo:edit"><li><a href="${ctx}/classinfo/classInfo/form">班级添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="classInfo" action="${ctx}/classinfo/classInfo/" method="post" class="breadcrumb form-search" autocomplete="off">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<div class="breadcrumb">
			<table class="table table-bordered">
				<tr>
					<th>名称：</th>
					<td>
						<form:input path="className" class="span2 minWidth"/>
					</td>
					<th>编码：</th>
					<td>
						<form:input path="classCode" class="span2 minWidth"/>
					</td>
				</tr>
			</table>
		</div>
		<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
		<input id="btnReset" type="button" class="btn btn-primary" value="重置"/>
		<%--<input onclick="down()" class="btn btn-primary" type="button" value="导出"/>
		<input id="btnPrint" class="btn btn-primary" type="button" value="打印"/>--%>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
			    <th>序号</th>
				<th>名称</th>
				<th>编码</th>
				<th>创建日期</th>
				<th>创建者</th>
				<shiro:hasPermission name="classinfo:classInfo:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="classInfo" begin="0" varStatus="status">
			<tr>
			    <td>
				    ${(page.pageNo-1)*page.pageSize+status.index+1 }
				</td>
				<td><a href="${ctx}/classinfo/classInfo/form?id=${classInfo.id}">
					${classInfo.className}
				</a></td>
				<td>
					${classInfo.classCode}
				</td>
				<td>
					<fmt:formatDate value="${classInfo.updateDate}" pattern="yyyy-MM-dd"/>
				</td>
				<td>
					${classInfo.user.name}
				</td>
				<shiro:hasPermission name="classinfo:classInfo:edit"><td>
    				<a href="${ctx}/classinfo/classInfo/form?id=${classInfo.id}">修改</a>
					<a href="${ctx}/classinfo/classInfo/delete?id=${classInfo.id}" onclick="return confirmx('确认要删除该班级管理吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>